package io.test.config;

import io.github.libkodi.basic_gateway.confituration.AbstractConfigurater;
import io.github.libkodi.vertxauth.VertxWebAuth;
import io.github.libkodi.vertxauth.filter.JwtAuthDealm;
import io.vertx.core.Future;

public class AuthConfiguration extends AbstractConfigurater {

	@Override
	public Future<Void> init() {
		return Future.future(promise -> {
			VertxWebAuth auth = ctx.components().get(VertxWebAuth.class).result();
			
			auth.filter("^/v2/.+$", new JwtAuthDealm());
			
			promise.complete();
		});
	}

}
